gdkwindow: subsurface in gdk_window_get_parent()
authorOlivier Fourdan <ofourdan@redhat.com>
Wed, 1 Feb 2017 14:09:52 +0000 (15:09 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Thu, 30 Mar 2017 13:46:25 +0000 (15:46 +0200)
commit19ce6a8bc5a13cef322932ea302164127f355865
tree2696f400bd931914361029d6b9438b5a74a6fc2c
parent2761fae728138b28538c0c8a9fa74919129d7b75
gdkwindow: subsurface in gdk_window_get_parent()

When the GtkWidget hierarchy does not match the GdkWindow hierarchy, the
GtkWidget code may find a common ancestor that cannot be found while
traversing the GdkWindow tree using gdk_window_get_parent().

This happens with for example on Wayland, a GtkPopover has another
GtkPopover as parent, in this case, the GdkWindow parent is the root
window, whereas the GtkWidget parent is the other GtkPopover.

That confuses the gtk_widget_translate_coordinates() logic which will
bail out in this case and won't return the translated coordinates.

Make gdk_window_get_effective_parent() aware of subsurfaces and use the
transient_for which represents the actual parent (whereas the parent
might be pointing to the root window).

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=774148
gdk/gdkwindow.c